package com.gladlee;

import org.jboss.netty.buffer.ChannelBuffer;
//import org.jboss.netty.channel.SimpleChannelHandler;
import org.jboss.netty.channel.*;;

public class DiscardServerHandler extends SimpleChannelHandler {
	@Override
	public void messageReceived(ChannelHandlerContext ctx,MessageEvent e){
		/*ChannelBuffer buf=(ChannelBuffer)e.getMessage();
		while(buf.readable()){
			System.out.println((char)buf.readByte());
			System.out.flush();
		}*/
		Channel ch=e.getChannel();
		ch.write(e.getMessage());
	}
	@Override
	public void exceptionCaught(ChannelHandlerContext ctx,ExceptionEvent e){
		e.getCause().printStackTrace();
		Channel ch=e.getChannel();
		ch.close();
	}
}

